package com.example.java.kafka.es7client;

import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.indices.GetIndexRequest;
import org.elasticsearch.client.indices.GetIndexResponse;

public class SearchIndex {
    public static void main(String[] args) {
        ConnectElasticsearch.connect(client -> {
            // 查询索引 - 请求对象
            GetIndexRequest request = new GetIndexRequest("user");
            // 发送请求，获取响应
            GetIndexResponse response = client.indices().get(request, RequestOptions.DEFAULT);
            System.out.println("aliases: "+response.getAliases());
            System.out.println("mappings: "+response.getMappings());
            System.out.println("settings: "+response.getSettings());
        });
    }
}
